<template>
  <el-card class="tijian-container" shadow="hover">
    <div class="page-header">
      <h2 class="page-title">体检管理</h2>
      <div class="header-actions">
        <el-button type="primary" size="small" icon="Plus">新增</el-button>
      </div>
    </div>
    <el-tabs v-model="activeTab" type="border-card" class="custom-tabs">
      <el-tab-pane label="体验套餐" name="basic">
        <transition name="fade-transform" mode="out-in">
          <Project v-if="activeTab === 'basic'" />
        </transition>
      </el-tab-pane>
      <el-tab-pane label="体验项目" name="columnInfo">
        <transition name="fade-transform" mode="out-in">
          <Examintions v-if="activeTab === 'columnInfo'" />
        </transition>
      </el-tab-pane>
      <el-tab-pane label="套餐类型" name="genInfo">
        <transition name="fade-transform" mode="out-in">
          <Package v-if="activeTab === 'genInfo'" />
        </transition>
      </el-tab-pane>
    </el-tabs>
  </el-card>
</template>

<script lang="ts">
import Project from "../project/index.vue";
import Examintions from "../examintions/index.vue";
import Package from "../package/index.vue";

export default {
  name: "GenInfo",
  components: { Package, Examintions, Project },
  data() {
    return {
      activeTab: 'basic'
    }
  },
}
</script>

<style lang="scss" scoped>
.tijian-container {
  margin: 16px;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);

  .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 12px;

    .page-title {
      font-size: 17px;
      color: #606266;
      margin: 0;
      font-weight: 500;
      letter-spacing: 1px;
    }

    .header-actions {
      display: flex;
      gap: 8px;
      .el-button {
        font-size: 13px;
        padding: 5px 14px;
        border-radius: 3px;
        background: #f5f7fa;
        color: #606266;
        border: 1px solid #ebeef5;
      }
    }
  }
}

.custom-tabs {
  border-radius: 4px;
  overflow: hidden;
  box-shadow: none;

  :deep(.el-tabs__header) {
    margin: 0;
    background: #fafbfc;
    border-bottom: 1px solid #ebeef5;
  }

  :deep(.el-tabs__content) {
    padding: 14px;
    min-height: 320px;
    background: #fff;
  }

  :deep(.el-tabs__item) {
    height: 38px;
    line-height: 38px;
    font-size: 14px;
    transition: color 0.2s;
    &:hover {
      color: #409EFF;
    }
    &.is-active {
      font-weight: 500;
      color: #409EFF;
      background: #fff;
    }
  }
}

// 页面切换动画（简化动画）
.fade-transform-enter-active,
.fade-transform-leave-active {
  transition: opacity 0.2s;
}
.fade-transform-enter-from,
.fade-transform-leave-to {
  opacity: 0;
  transform: none;
}

// 响应式调整
@media screen and (max-width: 768px) {
  .tijian-container {
    margin: 6px;
    .page-header {
      flex-direction: column;
      align-items: flex-start;
      gap: 8px;
      .header-actions {
        width: 100%;
        justify-content: flex-end;
      }
    }
  }
  .custom-tabs {
    :deep(.el-tabs__content) {
      padding: 8px;
    }
  }
}
</style>
